From: Andris PE Date: Mon, 2 Sep 2024 15:38:59 +0000 (+0000) Subject: init: remove unnecessary stop logic X-Git-Url: http://git.openwrt.org/%22https:/collectd.org//%22/%22https:/collectd.org/%22?a=commitdiff_plain;h=00fc6943a29732375addf72a12f2381df5b25428;p=project%2Ffirewall4.git init: remove unnecessary stop logic Always remove table and service state to have consistent cleaned up system state on exit even if user intentionally dropped our table. Removes dependency on grep as a consequence. Ref: https://wiki.nftables.org/wiki-nftables/index.php/Configuring_tables Supersedes: https://github.com/openwrt/firewall4/pull/33 Signed-off-by: Andris PE --- diff --git a/root/sbin/fw4 b/root/sbin/fw4 index c3e95c2..d9ac8a1 100755 --- a/root/sbin/fw4 +++ b/root/sbin/fw4 @@ -49,12 +49,9 @@ stop() { { flock -x 1000 - if nft list tables inet | grep -sq "table inet fw4"; then - nft delete table inet fw4 - rm -f $STATE - else - return 1 - fi + nft delete table inet fw4 + rm -f $STATE + } 1000>$LOCK }